/* 
 * Gneat (http://gneat.org)
 *
 * (C) Copyright 2011 and beyond - Claudio Stella, all rights reserved.
 *
 * This file is part of Gneat.
 *
 * Gneat is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License (LGPL)
 * as published by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Gneat is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * and the GNU General Public License, for completeness, along with Gneat.  
 * If not, see <http://www.gnu.org/licenses/>.
 */
package org.neatshell.gneat.client.presenter.core.manipulation;

import org.neatshell.gneat.client.presenter.core.IPresenter;

public interface Attributes {
	public enum Attribute { 
		ACTION("action"),
		CELLSPACING("cellSpacing"),
		CELPADDING("cellPadding"),
		CHECKED("checked"),
		CLASS("className"),
		COLSPAN("colSpan"),
		CONTENTEDITABLE("contentEditable"),
		DIR("dir"),
		DISABLED("disabled"),
		ENCTYPE("enctype"),
		FOR("htmlFor"),
		FRAMEBORDER("frameBorder"),
		HREF("href"),
		ID("id"),
		LABEL("label"),
		MAXLENGTH("maxLength"),
		METHOD("method"),
		NAME("name"),
		READONLY("readOnly"),
		ROWSPAN("rowSpan"),
		SELECTED("selected"),
		SIZE("size"),
		SRC("src"),
		STYLE("style"), 		
		TABINDEX("tabIndex"), 		
		TARGET("target"),		
		TITLE("title"),				
		URL("url"),		
		USEMAP("useMap"),
		VALUE("value");
		
		private String _name;
		
		Attribute(String name) {
			_name = name;
		}
	
		public String getName() {
			return _name;
		}
	}

  /*
   * Set 
   */
	IPresenter attr(Attribute attr, String value);
	IPresenter attr(String name, String value);
	String attr(Attribute attr);
	String attr(String attrName);

	boolean hasAttr(Attribute...attrs);
	boolean hasAttr(String...attrNames);
	

	/**
	 * Get this presenter's id.
	 * @return this presenter's id
	 */
	String id();

	/**
	 * Get this presenter's id.
	 * @param auto true to auto generate an unique id if it has not yet been set.
	 * @return this presenter's id
	 */
	String id(boolean auto);

	/**
	 * Set this presenter's id
	 * @param id the id value to set
	 */
	IPresenter id(String id);

	IPresenter removeAttr(Attribute... attrs);
	IPresenter removeAttr(String... attrNames);
}